package com.wd.tech.view.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.wd.tech.R;
import com.wd.tech.bean.BiaotiSerchBean;
import com.wd.tech.bean.FabuBean;
import com.wd.tech.mvp.base.BaseActivity;
import com.wd.tech.mvp.base.BasePresenter;
import com.wd.tech.mvp.presenter.PresenterImpl;
import com.wd.tech.mvp.util.MyUrl;

import java.util.HashMap;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class Teizi extends BaseActivity {


    @BindView(R.id.quxiao)
    TextView quxiao;
    @BindView(R.id.fasong)
    TextView fasong;
    @BindView(R.id.evaluation_edit)
    EditText evaluationEdit;
    @BindView(R.id.endit)
    RelativeLayout endit;

    @Override
    protected void startCoding() {




    }

    @Override
    protected BasePresenter initPresenter() {
        return new PresenterImpl();
    }

    @Override
    protected void initView() {

    }

    @Override
    protected int Layout() {
        return R.layout.activity_teizi;
    }

    @Override
    public void onSuccess(Object o) {


        if (o instanceof FabuBean){

            Toast.makeText(this, ""+((FabuBean) o).getMessage(), Toast.LENGTH_SHORT).show();
        }
    }

    @Override
    public void onError(String error) {

    }


    @OnClick({R.id.quxiao, R.id.fasong})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.quxiao:
                finish();

                break;
            case R.id.fasong:

                String s = evaluationEdit.getText().toString();

                HashMap<String,Object> map1=new HashMap<>();
                map1.put("content",s);
                mPresenter.startpostInfoHava(MyUrl.teizhi,FabuBean.class,map1);
                break;
        }
    }
}
